package com.example.springboothello.conf;

import com.example.springboothello.listener.MyMulticaster;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.concurrent.Executors;
//@Component
@Configuration
public class MulticasterConfig {

    @Bean
    public MyMulticaster applicationEventMulticaster() {
        MyMulticaster applicationEventMulticaster = new MyMulticaster();
        applicationEventMulticaster.setTaskExecutor(Executors.newSingleThreadExecutor()) ;
        return applicationEventMulticaster ;
    }
}
